package controllers;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import entities.Question;

import models.QuestionModel;

import systems.RecentlyQuestion;

public class RssServlet extends HttpServlet {
	public void doGet(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException {
		
		QuestionModel questionModel = QuestionModel.getInstance();
		List<Question> questions = RecentlyQuestion.getQuestions();
		
		request.setAttribute("questions", questions);
		try {
			request.getRequestDispatcher("/pages/rss.jsp").forward(request, response);
		} catch (ServletException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
